﻿<!--#include file="conn.asp"--><!--#include file="inc/CHAR.INC"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="images/style.css" 
type=text/css rel=stylesheet>
<META content="MSHTML 6.00.3790.0" name=GENERATOR>
<style type="text/css">
<!--
.STYLE2 {color: #000000}
-->
</style>
</HEAD>
<BODY style="FONT-SIZE: 12px; v-text-align: center" leftMargin=0 topMargin=3
align="center" marginheight="0" marginwidth="0"><script language="javascript">


function MakeHTML(id)
{window.open("makehtml_ad.asp?type=page&id="+id,"","width=150,height=20,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");}
function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
//		if (e.name != 'chkall')
			e.checked = true// form.chkall.checked;
	}
}
</script>
<%
     MaxPerPage=50
   if not isempty(request("page")) then 
      currentPage=cint(request("page")) 
   else 
      currentPage=1 
   end if 
set rs=server.createobject("adodb.recordset")
sql="select * from ad order by id desc"
rs.open sql,conn,1,1
%>
<table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" style='margin-bottom:5px'>
  <tr> 
    <td colspan="9" bgcolor="#FFFFFF"><div align="center"><font color="#FF0000"><strong>广告管理 </strong></font></div></td>
  </tr>
  <tr> 
    <td width="11%" bgcolor="e1e1e1"> <div align="center" class="STYLE2">ID</div></td>
    <td width="44%" bgcolor="e1e1e1"> <div align="center" class="STYLE2">广告名称</div></td>
    <td width="23%" bgcolor="e1e1e1"> <div align="center" class="STYLE2">操作</div></td>
  </tr>
  <%if rs.eof then%>
  <tr>
    <td colspan="8" bgcolor="#FFFFFF"><div align="center">没有任何内容</div></td>
  </tr>
  <%
  else
allshu=rs.recordcount
rs.pagesize=MaxPerPage 
mpage=rs.pagecount     
rs.move  (currentPage-1)*MaxPerPage
i=0
id=rs("id")


do while not rs.eof
%>
  <tr bgcolor="#FFFFFF"> 
    <td> <div align="center">
        <%=rs("id")%>
      </div></td>
    <td>
      <%=rs("adtitle")%> (<%=rs("adfilename")%>)</td>
    <td> <div align="center"><a href="ad_admin.asp?id=<%=rs("id")%>&act=modify"> </a><a href="javascript:MakeHTML(<%=rs("id")%>)" title="生成HTML页">生成</a> <a href="ad_admin.asp?id=<%=rs("id")%>&act=modify">修改</a>&nbsp;<a href="ad_admin.asp?id=<%=rs("id")%>&act=del" onClick="{if(confirm('确定删除此歌曲吗，此操作不可恢复!?')){return true;}return false;}">删除</a></div></td>
  </tr>
  <% i=i+1 
rs.movenext 
loop 
rs.close
end if
set rs=nothing
set conn=nothing%>
</table>
<table border="0" width="100%" height="26" cellspacing="0" cellpadding="0" bgcolor="#eeeeee">
  <tr> 
    <td width="15%" nowrap>&nbsp;页次：<b><font color="ff0000"> 
      <%=currentPage%>
      </font></b>/<b> 
      <%=mpage%>
      </b>&nbsp;每页&nbsp;<b><font color="ff0000"> 
      <%=MaxPerPage%>
      </font></b> 共 &nbsp;<b><font color="ff0000"> 
      <%=allshu%>
      </font></b></td>
    <td width="65%" nowrap><p align="center"> 
        <%pageno=currentPage  
		if cint(pageno)>1 then%>
        <a href=ad_manage.asp?page=1&type=<%=request("type")%> title="最前页"> 
        <%end if%>
        <font face="Webdings">9</font></a> 
        <% if cint(pageno)>1 then%>
        <a href=ad_manage.asp?page=<%=currentPage-1%>&type=<%=request("type")%> title="上一页"> 
        <%end if%>
        <font face="Webdings">7</font></a> 
        <%pp=cint(pageno)-2            
  if pp<1 then            
  pp=1            
  end if            
p=0
for pno=pp to mpage
p=p+1
if pno*1=cint(pageno)*1 then%>
        <font color="#FF0000">[ 
        <%=pno%>
        ]</font> 
        <%else%>
        <a href=ad_manage.asp?page=<%=pno%>&type=<%=request("type")%> title="第<%=pno%>页">[ 
        <%=pno%>
        ]</a
> 
        <%end if%>
        <%if p>=5 then exit for            
next%>
        <% if cint(pageno)< mpage then%>
        &nbsp;<a href=ad_manage.asp?page=<%=currentPage+1%>&type=<%=request("type")%> title="下一页"> 
        <%end if%>
        <font face="Webdings">8</font></a>&nbsp; 
        <% if cint(pageno)< mpage then%>
        <a href=ad_manage.asp?page=<%=mpage%>&type=<%=request("type")%> title="最后页"> 
        <%end if%>
        <font face="Webdings">:</font></a></p></td>
    <td width="18%" nowrap><table cellpadding="0" cellspacing="0">
        <form onSubmit="window.location=this.KKK2.options[this.KKK2.selectedIndex].value; return false;">
          <tr> 
            <td nowrap>到 
              <select name="select" onChange="javascript:window.location.href=this.options[this.selectedIndex].value">
                <%   for i2=1 to mpage
      selected=""
      if currentpage=i2 then
          selected=" selected"
      end if%>
                <option value=ad_manage.asp?page=<%=i2%>&type=<%=request("type")%> <%=selected%>> 
                <%=i2%>
                </option>
                <%next%>
              </select>
              页</td>
        </form>
      </table></td>
  </tr>
</table>
</BODY></HTML>
<%set rs=nothing
set conn=nothing%>